package com.example.demo.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

@Entity
public class Funtype {
    private int ftId;
    private String ftName;
    private List<Fun> gn;

    @Id
    @Column(name = "ftId", nullable = false)
    public int getFtId() {
        return ftId;
    }

    public void setFtId(int ftId) {
        this.ftId = ftId;
    }

    @Basic
    @Column(name = "ftName", nullable = true, length = 30)
    public String getFtName() {
        return ftName;
    }

    public void setFtName(String ftName) {
        this.ftName = ftName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Funtype funtype = (Funtype) o;
        return ftId == funtype.ftId &&
                Objects.equals(ftName, funtype.ftName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ftId, ftName);
    }

    @OneToMany(mappedBy = "gnlx")
    public List<Fun> getGn() {
        return gn;
    }

    public void setGn(List<Fun> gn) {
        this.gn = gn;
    }
}
